package org.soarsky.wealthchengdu.module.focus;

import org.soarsky.wealthchengdu.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.MediaController;
import android.widget.VideoView;

/**
 * 播放视频界面
 * 
 * @author huang
 * 
 */
public class VideoViewPlayActivity extends Activity {

	private VideoView videoView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_videoplay);
		init();
	}

	private void init() {
		videoView = (VideoView) findViewById(R.id.activity_videoview);
		setpathvideo();
	}

	/**
	 * 加载视频
	 */
	public void setpathvideo() {
		videoView.setVideoPath("android.resource://org.soarsky.wealthchengdu/"
				+ R.raw.china);
		MediaController mMediaCtrl = new MediaController(
				VideoViewPlayActivity.this);
		mMediaCtrl.setAnchorView(videoView);
		videoView.setMediaController(mMediaCtrl);
		videoView.start();

		// Uri uri =
		// Uri.parse("rtsp://v2.cache2.c.youtube.com/CjgLENy73wIaLwm3JbT_%ED%AF%80%ED%B0%819HqWohMYESARFEIJbXYtZ29vZ2xlSARSB3Jlc3VsdHNg_vSmsbeSyd5JDA==/0/0/0/video.3gp");
		//
		// palyVideo.setMediaController(new MediaController(context));
		// palyVideo.setVideoURI(uri);
		// //videoView.start();
		// palyVideo.requestFocus();
	}

}
